package day20180129.designMode.four_Factory;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 14394 on 2018/1/29.
 */

//工厂子类，来生成具体的产品
public class IDCardFactory extends Factory {

    private List owners= new ArrayList();


    @Override
    protected Product createProduct(String owner) {
        return new IDCard(owner);
    }

    @Override
    protected void registerProduct(Product product) {
        owners.add(((IDCard)product).getOwner());
    }

    public List getOwners() {
        return owners;
    }
}
